Form at sales-training/enquiry/index.html stuck on "SENDING..." when submitted from browser. Curl test passed because curl used correct field names manually.
Field name mismatch in the JS submit handler payload:
| Form sent | Worker expected |
|---|---|
participants |
pax |
dates |
tentative_date |
| (missing) | company_address |
| (missing) | venue |
document.getElementById('participants') and document.getElementById('dates') return null (those IDs do not exist in the HTML). Calling .value on null throws a TypeError. The try/catch catches it and re-enables the button — but only after the async fetch is already in flight with a broken payload. The worker receives pax: undefined and tentative_date: undefined, proceeds to Puppeteer PDF generation, which takes 10–30s, and the form fetch has no timeout — so the browser waits indefinitely (Cloudflare 30s CPU wall eventually kills it).
The form HTML already had the correct IDs: id="pax" and id="tentative_date". The bug was only in the JS payload object.
File: sales-training/enquiry/index.html
Corrected the payload in the submit handler:
participants → pax (reads #pax)dates → tentative_date (reads #tentative_date)company_address (reads #company_address)venue (reads #venue){ name, company, company_address, email, phone, tentative_date, venue, pax, hrdc_option, message }Fix committed. Redeploy the static site (or CF Pages will auto-deploy on push).